﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chinaer.IDao;
using Chinaer.Cache;
using System.Transactions;

namespace Chinaer.Dao
{
    public class ShangJiaDAO : Repository, IShangJiaDAO
    {
        IDao.IShangJiaDAO shangJiaDAO = new EF.ShangJiaDAO();

        public bool EnableTrack
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public IList<Model.Entities.Model_ShangJia> Query(string sql, int pageIndex, out int recordCount, int pageSize=20, params System.Data.SqlClient.SqlParameter[] sqlParams)
        {
            return shangJiaDAO.Query(sql, pageIndex, out recordCount, pageSize, sqlParams);
        }

        public Model.Entities.Model_ShangJia GetByID(string id)
        {
            return shangJiaDAO.GetByID(id);
        }

        public bool Exists(string id)
        {
            return shangJiaDAO.Exists(id);
        }

        public bool Add(Model.Entities.Model_ShangJia entity)
        {
            return shangJiaDAO.Add(entity);
        }

        public bool Update(Model.Entities.Model_ShangJia entity)
        {
            return shangJiaDAO.Update(entity);
        }

        public bool Delete(Model.Entities.Model_ShangJia entity)
        {
            return shangJiaDAO.Delete(entity);
        }

        public bool Delete(string id)
        {
            return shangJiaDAO.Delete(id);
        }

        public int DeleteByIDs(IList<string> listID)
        {
            return shangJiaDAO.DeleteByIDs(listID);
        }

        public Model.Entities.Model_ShangJia GetByName(string name)
        {
            Model.Entities.Model_ShangJia shangjia = shangJiaDAO.GetByName(name);
            return shangjia;
        }
        public List<Model.Entities.Model_ShangJia> GetAllShangJias()
        {
            return shangJiaDAO.GetAllShangJias();
        }


    }
}
